/*
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3 + 10;
ll n;
ll a[N];
ll sum1[N], sum2[N];
ll res = 1e9;
int main()
{
  scanf("%lld", &n);
  for (ll i = 0; i < n; i ++)
  {
    scanf("%lld", &a[i]);
  }
  sum1[0] = a[0];
  sum2[2] = a[2];
  for (ll i = 0; i < n; i ++)
  {
    for (ll j = i + 1; j < n; j ++)
    {
    	sum1[j] = sum1[j - 1] + a[j];
      for (ll k = j + 1; k < n; k ++)
      {
        for (ll l = k + 1; l < n; l ++)
        {
           sum2[l] = sum2[l - 1] + a[l];
           res = min(res, abs(sum1[j] - sum2[l]));
        }
      }
    }
  }
  printf("%lld", res);
  return 0;
}
*/

#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
typedef long long ll;
ll n;
ll h[N];
ll mx = 0;
ll s;
vector<ll> v(n);
ll lcm(ll x, ll y)
{
  ll a = x, b = y;
  while(y)
  {
    ll tmp = y;
    y = x % y;
    x = tmp;
  }
  return a * b / x; 
}
int main()
{
  scanf("%lld", &n);
  for (ll i = 0; i < n; i ++)
  {
    scanf("%lld", &h[i]);
  }
  sort(h, h + n);
  for (ll i = 0; i < n; i ++)
  {
    for (ll j = i + 1; j < n; j ++)
    {
      for (ll k = j + 1; k < n; k ++)
      { 
        ll a = lcm(h[i],h[j]);
        ll b = lcm(h[i],h[k]);
        ll c = lcm(h[j],h[k]);
        ll d = lcm(a, h[k]);
        s = h[i] * h[j] * h[k] * d / (a * b * c);
        if(s > mx)
        {
          mx = s;
          v[0] = h[i];
          v[1] = h[j];
          v[2] = h[k];
        }
      }
    }
  }
  cout << v[0] << " " << v[1] << " " << v[2];
  return 0;
}
